Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[maint] Fix CI (GitHub actions workflow and tox.ini) #55

Merged
merged 15 commits into from
Sep 23, 2024

Conversation

psobolewskiPhD
Copy link
Contributor

@psobolewskiPhD psobolewskiPhD commented Sep 14, 2024

The github action and tox.ini got out of sync with some strange multi-python tox envs:
https://github.com/MouseLand/cellpose-napari/actions/runs/10851583106/job/30115669221?pr=33#step:7:157

In this PR I try to clean up old/unused elements from the github actions workflow and update tox.ini to python 3.9-3.12.
I also add using concurrency so that multiple pushes will cancel tests, rather than piling them up.
I restored macOS, ubuntu, and Windows tests, updating the test suite to specify model cyto3 such that the expected values can be specified.
I also monkeypatch such that on CI CPU is used. This gives a different diameter value, so I split the difference in the isclose so that tests work on CI and locally.
Finally I do some cleanup of imports and comments.

@carsen-stringer
Copy link
Member

thanks so much @psobolewskiPhD !! the MPS error looks strange to me -- it says it's out of memory? otherwise the windows errors are expected due to changes in the dynamics code resulting in different numbers of cells from cellpose v2 and beyond

@psobolewskiPhD
Copy link
Contributor Author

Yea sorry I just left it last night, I was tracking down the failures and got sleepy.
The actual test errors are indeed just because the defaults have changed. I will explicitly set the model to prevent that in the future.
The MPS fail is this:
actions/runner-images#9918
which points to the runner docs: https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#limitations-for-arm64-macos-runners
It's interesting that cellpose proper tests don't hit this? I will take a look, maybe y'all have a clever solution there.
Otherwise I think the solution is to monkey patch MPS availability on CI.

@carsen-stringer
Copy link
Member

Thanks! Ah no we did also have failing regression tests, and I've updated the expected output with each release, so we can do that here too by re-setting the assert values - or I can change it to the same regression tests as cellpose (although I don't have a diameter test there)

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.08%. Comparing base (ef6d108) to head (dacf1e4).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #55      +/-   ##
==========================================
+ Coverage   54.31%   60.08%   +5.77%     
==========================================
  Files           3        3              
  Lines         232      233       +1     
==========================================
+ Hits          126      140      +14     
+ Misses        106       93      -13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@psobolewskiPhD
Copy link
Contributor Author

psobolewskiPhD commented Sep 14, 2024

Ok, things are working.
The logic here: https://github.com/MouseLand/cellpose/blob/52f75f9636250979dcff48da18d24aaff41c2c86/cellpose/core.py#L90-L108
Doesn't really handle passing gpu=True and yet having mps backend is_available() return False because of the nested if in try (which doesn't except).
So I monkeypatched that function too to be safe.

The diameter value I get when running locally with MPS is different than with CPU, so I split the difference so that I can run tests locally. And I explicitly set cyto3 and the number of cells I get with that.

I'll try re-enabling Ubuntu tests next.

@psobolewskiPhD
Copy link
Contributor Author

@carsen-stringer I think it's ready for review now 😃

@carsen-stringer carsen-stringer merged commit c1722c4 into MouseLand:main Sep 23, 2024
13 checks passed
@carsen-stringer
Copy link
Member

thank you so much! 🔥 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants